<!DOCTYPE html>
<html>
<head>
<title>文章</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="../../css/bootstrap.min.css">
<link rel="stylesheet" href="../../css/font-awesome.min.css">
<link rel="stylesheet" href="../../plugins/jqgrid/ui.jqgrid-bootstrap.css">
<link rel="stylesheet" href="../../plugins/ztree/css/metroStyle/metroStyle.css">
<link rel="stylesheet" href="../../css/main.css">
<link rel="stylesheet" href="../../plugins/layer/laydate/need/laydate.css">
<link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/summernote/0.8.1/summernote.css">
<script src="../../libs/jquery.min.js"></script>
<script src="../../plugins/layer/layer.js"></script>
<script src="../../libs/bootstrap.min.js"></script>
<script src="../../libs/vue.min.js"></script>
<script src="../../plugins/jqgrid/grid.locale-cn.js"></script>
<script src="../../plugins/jqgrid/jquery.jqGrid.min.js"></script>
<script src="../../plugins/ztree/jquery.ztree.all.min.js"></script>
<script src="../../plugins/suggest/bootstrap-suggest.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/summernote/0.8.1/summernote.js"></script>
<script src="../../js/common.js"></script>
</head>
<body class="gray-bg">
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			<div class="form-group col-sm-2">
				<input type="text" class="form-control" v-model="q.titles" @keyup.enter="query" placeholder="标题">
			</div>
			<div class="form-group col-sm-2">
					<select class="form-control" v-model="q.status" @keyup.enter="query" placeholder="状态">
						<option value="">选择状态</option>
						<option value="1">发布</option>
						<option value="2">草稿</option>
					</select>
			</div>

			<a class="btn btn-default" @click="query">查询</a>
			<a v-if="hasPermission('modules:news:save')" class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			<a v-if="hasPermission('modules:news:update')" class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			<a v-if="hasPermission('modules:news:delete')" class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
    <div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
											<div class="form-group">
			   	<div class="col-sm-2 control-label">文章名称</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="news.title" placeholder="文章名称"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">浏览数</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="news.countView" placeholder="浏览数"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">评论数</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="news.countComment" placeholder="评论数"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">类型：</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="news.type" placeholder="类型："/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">状态：</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="news.status" placeholder="状态"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">是否评论:</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="news.isComment" placeholder="是否评论："/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">是否推荐:</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="news.isRecommend" placeholder="是否推荐："/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">排序:</div>
			   	<div class="col-sm-10">
			      <input type="number" class="form-control" v-model="news.sort" placeholder="排序"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">审核状态:</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="news.approveStatus" placeholder="审核状态"/>
			    </div>
			</div>
			<div class="form-group">
				<label
						class="col-sm-2 control-label">内容：</label>
				<div class="col-sm-10" style="width: 925px;border-left-width: 20px;padding-left: 110px;">
					<div class="ibox-content no-padding">
						<div id="summernote" class="summernote" v-html="news.content"></div>
					</div>
				</div>

			</div>
							<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-primary" @click="saveOrUpdate" id="btn1" value="发布"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>
</div>

<script src="../../js/modules/news/news.js"></script>
<script type="text/javascript">
    //调用富文本编辑
    $(document).ready(function() {
        var $summernote = $('#summernote').summernote({
            height: 300,
            minHeight: null,
            maxHeight: null,
            focus: true
        });
    });
</script>
</body>
</html>